{:W('Cate/header')}
{:W('Cate/left')}
<!--内容部分-->
<div class="content">
    <div class="title">
        <p>系统管理</p>
        <i class="icon-angle-right"></i>
        <p class="active">操作日志</p>
    </div>
    <div class="admin_list clearfix">
        <div class="main">
            <div class="main_title">
                <form action="{:U('operation_log/operation_log')}" method="get">
                <ul class="clearfix">
                    <li>
                        <span>账号</span>
                        <input value="{$param.user}" maxlength="20" name="user" type="text" >
                    </li>
                    <li>
                        <span>开始时间</span>
                        <if condition="$param['begintime'] eq true">
                        <input value="{$param.begintime|date='Y-m-d H:i:s',###}" readonly name="begintime" placeholder="请选择开始时间" type="text" id="begintime">
                        <else/>
                        <input value="" readonly name="begintime" placeholder="请选择开始时间" type="text" id="begintime">
                        </if>
                    </li>
                    <li>
                        <span>结束时间</span>
                        <if condition="$param['endtime'] eq true">
                            <input value="{$param.endtime|date='Y-m-d H:i:s',###}" readonly name="endtime" placeholder="请选择结束时间" type="text" id="endtime">
                            <else/>
                            <input value="" readonly name="endtime" placeholder="请选择结束时间" type="text" id="endtime">
                        </if>
                    </li>
                    <button><img src="__PUBLIC__/images/seach.png">搜索</button>
                </ul>
                </form>
            </div>
            <div class="main_list" style="padding-top:15px;">
                <div class="main_list_list user_list">
                    <dl>
                        <dt>
                            <span style="width:5%">序号</span>
                            <span style="width:20%">操作时间</span>
                            <span style="width:15%">账号</span>
                            <span style="width:60%;text-align:center;padding-left:20px;">操作内容</span>
                        </dt>
                        <volist name="array['logs']" id='row' key="k">
                        <dd>
                            <span style="width:5%">{$k}</span>
                            <span style="width:20%">
                            {$row['logtime']|date="Y-m-d H:i:s",###}
                            </span>
                            <span style="width:15%">{$row['username']}</span>
                            <span style="width:60%;text-align:left;padding-left:20px;">{$row['loginfo']}</span>

                        </dd>
                        </volist>
                    </dl>
                </div>
            </div>
            <div class="fy" id="page"></div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    layui.use('laydate', function() {
        var laydate = layui.laydate;

        //执行一个laydate实例
        laydate.render({
            elem: '#begintime', //指定元素
            format: 'yyyy-MM-dd HH:mm:ss', //日期格式
            type:'datetime',
        });

        laydate.render({
            elem: '#endtime', //指定元素
            format: 'yyyy-MM-dd HH:mm:ss', //日期格式
            type:'datetime',
        });
    });
    $(document).ready(function () {
        layui.use('laypage', function(){
            var laypage = layui.laypage;

            //执行一个laypage实例
            laypage.render({
                elem: 'page'
                ,count: "<?php echo $totnum; ?>"
                ,limit: "<?php echo $pagecount; ?>"
                ,layout: ['prev', 'page', 'next', 'limit', 'skip']
                ,curr:function(){
                    var page = location.search.match(/pageid=(\d+)/);
                    return page ? page[1] : 1;
                }()
                ,jump: function(obj,first){  //点击页码出发的事件
                    if(first!=true){  //是否首次进入页面
                        var user = "<?php echo $param['user']; ?>";
                        var begintime = "<?php echo $param['begintime']; ?>";
                        if(begintime){
                            begintime = "<?php echo date('Y-m-d H:i:s',$param['begintime']); ?>";
                        }
                        var endtime = "<?php echo $param['endtime']; ?>";
                        if(endtime){
                            endtime = "<?php echo date('Y-m-d H:i:s',$param['endtime']); ?>";
                        }
                        var _url = "/operation_log/operation_log?pageid="+obj.curr+"&pagecount="+obj.limit;
                        if(user || begintime || endtime){
                            _url = "/operation_log/operation_log?pageid="+obj.curr+"&pagecount="+obj.limit+"&user="+user+"&begintime="+begintime+'&endtime='+endtime;
                        }
                        window.location.href = _url;
                    }
                }
            });
        });
    });
</script>
</html>